pushd extremeKanban

EXT_DIR="./public/ext"
EXT_VERSION="3.2.1"
if [ ! -d $EXT_DIR ]; then
	echo "Ext not found in local dir, downloading..."
	pushd public
	wget http://www.extjs.com/deploy/ext-${EXT_VERSION}.zip
	unzip -q ext-${EXT_VERSION}.zip
	mv ext-${EXT_VERSION} ext
	popd
	echo "Done, now launching development server..."
else
	echo "Ext found, launching development server..."
fi

./manage.py syncdb
if [ "-bg" = "$1" ];then
	echo "Background launch..."
	./manage.py runserver &
	echo $! > server.pid
else
	./manage.py runserver
fi

popd